<%@ page import="com.habdqn.jspdemo.im.enetity.Company" %>
<%@ page import="java.util.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        request.setAttribute("num",1);
        Company company = new Company(1,"著名公司","北京","编的","", 4, new Date(), null);
        request.setAttribute("company",company);

        session.setAttribute("number",10);

        List<Company> companyList = new ArrayList<>();
        companyList.add(company);
        session.setAttribute("company",companyList);

        Map<String,Integer> maps = new HashMap<>();
        maps.put("str1",1);
        request.setAttribute("maps",maps);
    %>
<p>${maps["str1"]}</p>
<p>${num}</p>
<p>${company.name}</p>
<p>${company["city"]}</p>

<%--<p>${company.xxx}</p>--%>

<p>${number}</p>
<p>${xx}</p>
<p>${10/3}</p>
<p>${10/0}</p>

<p>${10 div 0}</p>
<p>${10 mod 3}</p>
<p>\${10 mod 3}</p>

<p>${sessionScope.company[0].city}</p>
    <hr>
    <%
        String str = "";
        request.setAttribute("str",str);
        List<String> list = new ArrayList<>();
        list.add("123");
        request.setAttribute("list",list);
    %>
    <%----%>
    <p>${empty str}</p>
    <p>${empty list}</p>

    <%
        request.setAttribute("var",10);
    %>
    <c:choose>
        <c:when test="${var <0 }">
            <p>小于0</p>
        </c:when>
        <c:when test="${var < 10 }">
            <p>小于10</p>
        </c:when>
        <c:when test="${var < 20 }">
            <p>小于20</p>
        </c:when>
        <c:otherwise>
            <p>默认值</p>
        </c:otherwise>
    </c:choose>

</body>
</html>
